//
//  DXWTabBarController.m
//  pandaTV
//
//  Created by 淡馨慰 on 16/8/19.
//  Copyright © 2016年 淡馨慰. All rights reserved.
//

#import "DXWTabBarController.h"
#import "DXWNavigationController.h"
#import "DXWHomePageViewController.h"
#import "DXWYouXiViewController.h"
#import "DXWYuLeViewController.h"
#import "DXWMineViewController.h"
#import "DXWGoddnessHTMLViewController.h"




@interface DXWTabBarController ()

@end

@implementation DXWTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor brownColor];
    
    //1. 初始化子控制器
    [self createChildViewController];
    
    //2. 初始化子控制器tabBar
    [self initChildViewControllertabBar];
    
    //3. 设置tabBar属性
    [self setValueFortabBar];
    
    
}
#pragma mark -tabBar属性
- (void)setValueFortabBar
{
    //tabBar文字渲染色
//    self.tabBar.tintColor = [UIColor colorWithRed:23/255.0 green:207/255.0 blue:136/255.0 alpha:1];
    self.tabBar.tintColor = dxw_MainColor ;
    
    //tabBar背景颜色
    [[UITabBar appearance] setBackgroundImage:[UIImage imageWithOriginalImageName:@"tabbar_bkg"]];
//    self.tabBar.backgroundImage = [UIImage imageWithOriginalImageName:@"tabbar_bkg"];
    
    //tabBar阴影颜色
    [[UITabBar appearance] setShadowImage:[UIImage imageWithOriginalImageName:@"tabbar_shadow_bkg"]];
//    self.tabBar.shadowImage = [UIImage imageWithOriginalImageName:@"tabbar_shadow_bkg"];
}

#pragma mark -初始化子控制器tabBar
- (void)initChildViewControllertabBar
{

    
    //1. 首页
    UIViewController *vc1 = self.childViewControllers[0];
    vc1.tabBarItem.title = @"首页";
    vc1.tabBarItem.image = [UIImage imageWithOriginalImageName:@"menu_homepage"];
    vc1.tabBarItem.selectedImage = [UIImage imageWithOriginalImageName:@"menu_homepage_sel"];
//
   //2. 游戏
    UIViewController *vc2 = self.childViewControllers[1];
    vc2.tabBarItem.title = @"游戏";
    vc2.tabBarItem.image = [UIImage imageWithOriginalImageName:@"menu_youxi"];
    vc2.tabBarItem.selectedImage = [UIImage imageWithOriginalImageName:@"menu_youxi_sel"];
    
    //3. 娱乐
    UIViewController *vc3 = self.childViewControllers[2];
    vc3.tabBarItem.title = @"娱乐";
    vc3.tabBarItem.image = [UIImage imageWithOriginalImageName:@"menu_yule"];
    vc3.tabBarItem.selectedImage = [UIImage imageWithOriginalImageName:@"menu_yule_sel"];
    
    //4. 女神
    UIViewController *vc4 = self.childViewControllers[3];
    vc4.tabBarItem.title = @"女神";
    vc4.tabBarItem.image = [UIImage imageWithOriginalImageName:@"menu_goddess_normal"];
    vc4.tabBarItem.selectedImage = [UIImage imageWithOriginalImageName:@"menu_goddess_sel"];
    
    
    //5. 我的
    UIViewController *vc5 = self.childViewControllers[4];
    vc5.tabBarItem.title = @"我的";
    vc5.tabBarItem.image = [UIImage imageWithOriginalImageName:@"menu_mine"];
    vc5.tabBarItem.selectedImage = [UIImage imageWithOriginalImageName:@"menu_mine_sel"];
    
    
    
}

#pragma mark -初始化子控制器
- (void)createChildViewController
{
    //1. 首页
    DXWHomePageViewController *homePageVC = [[DXWHomePageViewController alloc]init];
    DXWNavigationController *nav1 = [[DXWNavigationController alloc]initWithRootViewController:homePageVC];
    [self addChildViewController:nav1];
    
    
    //2. 游戏
    DXWYouXiViewController *youxiVC = [[DXWYouXiViewController alloc]init];
    DXWNavigationController *nav2 = [[DXWNavigationController alloc]initWithRootViewController:youxiVC];
    [self addChildViewController:nav2];

    
    
    //3. 娱乐
    DXWYuLeViewController *yuleVC = [[DXWYuLeViewController alloc]init];
    DXWNavigationController *nav3 = [[DXWNavigationController alloc]initWithRootViewController:yuleVC];
    [self addChildViewController:nav3];
    
    
    //4. 女神
//    DXWGoddessViewController *goddessVC = [[DXWGoddessViewController alloc]init];
//    DXWNavigationController *nav4 = [[DXWNavigationController alloc]initWithRootViewController:goddessVC];
//    [self addChildViewController:nav4];
    
    DXWGoddnessHTMLViewController *goddessVC = [[DXWGoddnessHTMLViewController alloc]init];
    DXWNavigationController *nav4 = [[DXWNavigationController alloc]initWithRootViewController:goddessVC];
    [self addChildViewController:nav4];
    
    
    //5. 我的
    DXWMineViewController *mineVC = [[DXWMineViewController alloc]init];
    DXWNavigationController *nav5 = [[DXWNavigationController alloc]initWithRootViewController:mineVC];
    [self addChildViewController:nav5];

    
    
  //DXWGoddnessHTMLViewController

}


@end
